Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Binary-strings/8086-Assembly/binary-strings-1.8086
Normal file
12
Task/Binary-strings/8086-Assembly/binary-strings-1.8086
Normal 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
|
||||
11
Task/Binary-strings/8086-Assembly/binary-strings-2.8086
Normal file
11
Task/Binary-strings/8086-Assembly/binary-strings-2.8086
Normal 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"
|
||||
14
Task/Binary-strings/8086-Assembly/binary-strings-3.8086
Normal file
14
Task/Binary-strings/8086-Assembly/binary-strings-3.8086
Normal 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue