- Thanks received
- 10,018
I just had to spend an hour trying to locate decent assembler, had to settle on Turbo Assembler![]()
I'm using debug and Notepad in a virtual machine on my Mac

I just had to spend an hour trying to locate decent assembler, had to settle on Turbo Assembler![]()

I'm using debug and Notepad in a virtual machine on my Mac![]()

mov ax,2
int 10
mov ax,b800
mov ds,ax
mov es,ax
mov ax,0730
xor di,di
mov cx,0a
rep stosw
mov di,12
mov al,[di]
inc al
cmp al,3a
je 125
mov [di],al
jmp 116
mov al,30
mov [di],al
sub di,2
js 130
jmp 119
mov ax,4c00
int 21
I am NOT ****ing using debug!
The ****ing program is buggy as heck - instead of killing zombies in L4D 2 I am doing this tulip now![]()
Tidied up, redundant line removed; 53 bytes, sets the screen mode at the start, completes the most significant digit, still stops having rolled over to zero rather than at 999..9, still doing only ten digits (change lines 7 and 9 for more or less):
Code:mov ax,2 int 10 mov ax,b800 mov ds,ax mov es,ax mov ax,0730 xor di,di mov cx,0a rep stosw mov di,12 mov al,[di] inc al cmp al,3a je 125 mov [di],al jmp 116 mov al,30 mov [di],al sub di,2 js 130 jmp 119 mov ax,4c00 int 21
---------------------------
MOV AX, 4C00h
INT 21h ; DOS Function Call
---------------------------
RET
will work so long as stack is not buggered, this should be like what 6 bytes reduction?![]()
---------------------------
MOV AX, 4C00h
INT 21h ; DOS Function Call
---------------------------
RET
will work so long as stack is not buggered, this should be like what 6 bytes reduction?![]()
Well, the DOS call takes care of some houskeeping that might be required by certain execution contexts, such as DOS shells that mimic task switching and so forth (like Win3.1):
- restores the terminate, ~Ctrl-Break~, and critical error exit addresses, flushes all buffers, frees memory and returns to DOS via the termination handler address.
- http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte835c.htm
Also, AL contains the return code, which would be useful if this was being run from a batch file which wanted to take some special action in the event of abnormal termination.
