flat assembler
Message board for the users of flat assembler.
Index
> DOS > print random number [bad sample code] |
Author |
|
LocoDelAssembly 24 Dec 2009, 15:58
Code: org 100h ;DOS 1+ - GET SYSTEM TIME ; ;AH = 2Ch ; ;Return: ;CH = hour CL = minute DH = second DL = 1/100 seconds mov ah, 2ch ; You was setting AL instead of AH here, so you was calling an unspecified function here int 21h ;DOS 1+ - WRITE CHARACTER TO STANDARD OUTPUT ;AH = 02h ;DL = character to write ; BUT, we have to convert the number to ASCII first mov al, dl mov ah, 0 mov cl, 10 div cl mov dh, ah mov dl, al add dl, '0' mov ah, 2 int 21h mov dl, dh add dl, '0' mov ah, 2 int $21 ;KEYBOARD - GET KEYSTROKE ; ;AH = 00h ; ;Return: ;AH = BIOS scan code AL = ASCII character xor ax, ax int $16 ; Just halting execution until some key is pressed. mov ax,4C00h int 21h |
|||
24 Dec 2009, 15:58 |
|
baldr 24 Dec 2009, 16:10
LocoDelAssembly wrote: ; You was setting AL instead of AH here, so you was calling an unspecified function here |
|||
24 Dec 2009, 16:10 |
|
dreamer85 24 Dec 2009, 16:16
jeez i have such a long way to go just when i think i got the hang of something it turns out i've made a complete mess!
thx guys. |
|||
24 Dec 2009, 16:16 |
|
DOS386 25 Dec 2009, 13:07
dreamer85 wrote: erm the idea is to get the seconds from 0..99 Timing code (32-bit DOS) : http://board.flatassembler.net/topic.php?t=8670 |
|||
25 Dec 2009, 13:07 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.