Administración de Base de Datos

martes, 26 de febrero de 2019

Mas ejemplos con la libreria emu8086.inc


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
include emu8086.inc



ORG    100h



PRINT 'Hola mundo!'



GOTOXY 10, 5



PUTC 65           ; 65 - es un código ASCII para 'A'

PUTC 'B'



RET               ; Regreso al sistema operativo.

END               ; Directiva para detener el compilador.






--------------------------------------------------------------------

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; demonstrate get_string and print_string
;----------------------------------------
include 'emu8086.inc'
ORG    100h

LEA    SI, msg1       ; set up pointer (SI) to msg
                      ; to ask for the number
CALL   print_string   ; print message that SI points to

LEA    DI, buffer     ; set up pointer (DI) to input buffer
MOV    DX, bufSize    ; set size of buffer
CALL   get_string     ; get name & put in buffer

LEA    SI, newln      ; point at CR/LF / Hello message 
CALL   print_string   ; print message that SI points to

RET                   ; return to operating system.

; data
msg1   DB "Enter your name: ", 0  
newln  DB 13, 10
       DB "Hello, "
buffer DB 20 DUP (0)  ; input buffer for get_string   
bufSize = $-buffer    ; calculates size of buffer

DEFINE_GET_STRING
DEFINE_PRINT_STRING
END                   ; directive to stop the compiler.



---------------------------------------------------------------------------------

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; demonstrate scan_num, print_num, pthis
;----------------------------------------
include 'emu8086.inc'
ORG    100h

LEA    SI, msg1       ; ask for the number
CALL   print_string   ;
CALL   scan_num       ; get number in CX.

MOV    AX, CX         ; copy the number to AX.

; print the following string:
CALL   pthis
DB  13, 10, 'You have entered: ', 0

CALL   print_num      ; print number in AX.

RET                   ; return to operating system.

; data
msg1   DB  'Enter the number: ', 0

; macros to define procs
DEFINE_SCAN_NUM
DEFINE_PRINT_STRING
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS  ; required for print_num.
DEFINE_PTHIS

END                   ; directive to stop the compiler.




http://jbwyatt.com/253/emu/asm_tutorial_05.html

No hay comentarios.:

Publicar un comentario

Programa 9 Colores 2

include 'emu8086.inc' CUADRO MACRO XI,YI,XF,YF,COLOR MOV AX, 0600H MOV BH, COLOR MOV BL, 00H MOV CH, YI MOV CL, XI MOV DH, Y...