|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I'm currently work on printing the date to the screen. It prints to the screen but the wrong numbers. First run it prints 0</00/00, Second 0:/00/00, and last run 18/00/00. It seems to be printing in ascii. All I have is the month part now, if I could only figure this out then I could finish the rest of the date (day and year)
;NASM Template ;CS2650 Assembler Program #2 ;Casey Jenkins ; [BITS 16] ;Set code generation to 16 bit mode %include 'exebin.mac' ;include file to simulate .com header EXE_Begin ;assembler directive to indicate executable begin [ORG 100H] ;set addressing to begin at 100H dtfld: db'00/00/0000' start: ;CLEARS SCREEN AND SCROLL AREA mov ah,06h ;function 06h (Scroll Screen) mov al,0 ;scroll all lines mov bh,000 ;Attribute (black) mov ch,0 ;Upper left row is zero mov cl,0 ;Upper left column is zero mov dh,23 ;Lower left row is 28 mov dl,79 ;Lower left column is 79 int 10H ;BIOS Interrupt 10h (video services) ;DISPLAYS NAME TO SCREEN mov ah,13h ;function 13h (Display String) mov al,0 ;Write mode is zero mov bh,0 ;Use video page of zero mov bl,0Ch ;Attribute (Red Text) mov cx,13 ;Character string is 25 long mov dh,4 ;position on row 4 mov dl,0 ;and column 28 push ds ;put ds register on stack pop es ;pop it into es register lea bp,[msg] ;load the offset address of string into BP int 10H ;GET DATE FROM SYSTEM ;;;;;;;;;;;;;;;; GET MONTH ;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov ah,1AH int 21h mov bh,dh ;copy contents to bh shr bh,1 ;shift one bit shr bh,1 shr bh,1 shr bh,1 or bh,30h ;add 30 to convert to ascii mov [dtfld],bh mov bh,dh and bh,0fh or bh,30h mov [dtfld + 1],bh int 04h ;DISPLAY DATE TO SCREEN mov ah,13h ;function 13h (Display String) mov al,0 ;Write mode is zero mov bh,0 ;Use video page of zero mov bl,0Ch ;Attribute (Red Text) mov cx,8 ;Character string is 25 long mov dh,5 ;position on row 4 mov dl,0 ;and column 28 ;push ds ;put ds register on stack ;pop es ;pop it into es register lea bp,[dtfld] ;load the offset address of string into BP int 10H msg: db'CASEY JENKINS' int 20h ;halt operation (VERY IMPORTANT!!!) EXE_End |
|
#2
|
|||
|
|||
|
Int 21h Function 1Ah sets the DTA - which has nothing to do with dates.
I suspect what you wanted was BIOS Int 1A function 0 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Assembly Print Date and Time |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|