Jump to content

NASM Random Numbers

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
JMC31337

JMC31337

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts
NASM random number generator........

[bits 16]
[org 100h]
[section .text]
jmp start
xxx:
mov ah,02ch ;sys time
int 21h
and dl,0fh
cmp dl,9
ja xxx
add dl,30h
mov [di],dl
ret
delay:
;mov cx,0
yyy:
mov dx,0a00h
zzz:
xor ax,ax
dec ax
cmp dx,0
jne zzz
loop yyy
ret
start:
mov di,numb
call xxx
inc di
call delay
call xxx
inc di
call delay
call xxx
mov ah,9h
mov dx,numb
int 21h
int 20h

numb db 4
db 0
times 4 db 0
db "$"

Edited by Jordan, 18 February 2009 - 06:48 AM.
Use [code] Tags

"Your Life Is Your Crime, It's Punishment Time"

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Moved to the correct section. Please use [noparse]
[/noparse] tags when posting code.