explod_javad
دوشنبه 30 اردیبهشت 1392, 12:17 عصر
با سلام
من میخام تو شبیه ساز emu8086 و با دستور 2ahعدد سال رو مانیتور چاپ کنم.
mov ah,2ah
int 21h
چاپ cX (سال) روی مانیتور ؟
کسی میتونه کمک کنه ؟
explod_javad
چهارشنبه 01 خرداد 1392, 10:12 صبح
یه نفر کمک کنه
:گریه:
salar_kian
جمعه 11 مرداد 1392, 16:25 عصر
سلام
نمیدونم به دردت بخوره یا نه!
چون خیلی ازوقت پستت گذشته!
.MODEL SMALL
.STACK 100h
.CODE
; call do_space
mov ax,2a00h ;get date from dos
int 21h
;Cx year (1980 - 2099)
;DH month
;DL day
;al day of week 0 == sun
push cx ;save year
push dx ;save month & day
mov ah,0
mov al,dl ;day
mov cl,10
div cl
push ax ;save tens (al) & units (ah) of day
or al,30h ;tens of day to ascii
mov dl,al
mov ah,02h
int 21h
pop ax
or ah,30h ;units of day to ascii
mov dl,ah
mov ah,02h
int 21h
call do_slash
pop dx ;restore month (dh)
mov ah,0
mov al,dh ;month
mov cl,10
div cl
push ax ;save tens (al) & units (ah) of month
or al,30h ;tens of month to ascii
mov dl,al
mov ah,02h
int 21h
pop ax
or ah,30h ;units of month to ascii
mov dl,ah
mov ah,02h
int 21h
call do_slash
pop ax ;year
mov dx,0 ;clr ms byte of dividend
mov cx,1000 ;and divide by 1000 to get thousands
div cx ;quotient in ax, remainder in dx
push dx ;save remainder
or al,30h ;into ascii
mov ah,02h
mov dl,al
int 21h
pop ax ;restore remainder
mov dx,0 ;clr msb
mov cx,100 ;get hundreds
div cx ;quotient in ax, remainder in dx
push dx ;save remainder
or al,30h ;into ascii
mov ah,02h
mov dl,al
int 21h
pop ax ;restore remainder
mov dx,0 ;clr msb
mov cx,10 ;get tens
div cx ;quotient in ax, remainder in dx
push dx ;save remainder
or al,30h ;into ascii
mov ah,02h
mov dl,al
int 21h
pop ax ;restore remainder (units)
or al,30h ;into ascii
mov ah,02h
mov dl,al
int 21h
mov ax,@data
mov ds,ax ;set DS to point to the data segment
mov ah,9 ;DOS print string function
; mov dx,OFFSET HelloMessage ;point to "Hello, world"
; int 21h ;display "Hello, world"
mov aX,4c00h ;DOS terminate program function
int 21h ;terminate the program
endp
do_space proc near
push ax
push dx
mov ah,02
mov dl,' '
int 21h
pop dx
pop ax
ret
endp
do_slash proc near
push ax
push dx
mov ah,02
mov dl,'/'
int 21h
pop dx
pop ax
ret
endp
END
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.