Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,12 @@
;this code assumes that both DS and ES point to the correct segments.
cld
mov si,offset TestMessage
mov di,offset EmptyRam
mov cx,5 ;length of the source string, you'll need to either know this
;ahead of time or calculate it.
rep movsb
ret
;there is no buffer overflow protection built into these functions so be careful!
TestMessage byte "Hello"
EmptyRam byte 0,0,0,0,0

View file

@ -0,0 +1,11 @@
;this code assumes that ES points to the correct segment.
cld
mov di,offset TestMessage
mov al,'o' ;the byte we wish to check
mov cx,5 ;len(Test)
repnz scasb ;scan through the string and stop if a match is found.
;flags will be set accordingly
ret
TestMessage byte "Hello"

View file

@ -0,0 +1,14 @@
;this code assumes that both DS and ES point to the correct segments.
cld
mov si,offset foo
mov di,offset bar
mov cx,4 ;length of the shorter of the two.
repz cmpsb
; this will continue until the strings are different or CX = 0,
; whichever occurs first. If, after this, the zero flag is set and CX=0,
; the strings were the same
ret
foo byte "test"
bar byte "test"