Simplify code by using cms EM_WSIZE to compare bytes.

This should work because the C compiler does it.
This commit is contained in:
George Koehler 2017-12-18 21:52:13 -05:00
parent a4e6595032
commit a5e8dc8a06
2 changed files with 20 additions and 33 deletions

View file

@ -32,13 +32,12 @@ size
cal $finished cal $finished
end /* $_m_a_i_n */ end /* $_m_a_i_n */
pro $check, 4 * EM_PSIZE + 2 * EM_WSIZE pro $check, 4 * EM_PSIZE + EM_WSIZE
#define p1 (-1 * EM_PSIZE) #define p1 (-1 * EM_PSIZE)
#define p2 (-2 * EM_PSIZE) #define p2 (-2 * EM_PSIZE)
#define p3 (-3 * EM_PSIZE) #define p3 (-3 * EM_PSIZE)
#define p4 (-4 * EM_PSIZE) #define p4 (-4 * EM_PSIZE)
#define b (p4 - 1 * EM_WSIZE) #define i (p4 - EM_WSIZE)
#define i (p4 - 2 * EM_WSIZE)
/* Set pointers to all 4 copies. */ /* Set pointers to all 4 copies. */
lae src lae src
@ -60,56 +59,49 @@ size
4 4
lal p4 lal p4
loi EM_PSIZE loi EM_PSIZE
loi 1 loi 1 /* byte from src */
loc 1
loc EM_WSIZE
cii
stl b /* b = byte from src */
lol b
lal p3 lal p3
loi EM_PSIZE loi EM_PSIZE
loi 1 /* byte from 3rd copy */ loi 1 /* byte from 3rd copy */
loc 1 cms EM_WSIZE
loc EM_WSIZE zeq *3
cii
beq *3
loc (3 * 256) loc (3 * 256)
lol i lol i
adi EM_WSIZE adi EM_WSIZE /* 0x300 + i */
loc EM_WSIZE loc EM_WSIZE
loc 4 loc 4
cuu cuu
cal $fail cal $fail
asp 4 asp 4
3 3
lol b lal p4
loi EM_PSIZE
loi 1 /* byte from src */
lal p2 lal p2
loi EM_PSIZE loi EM_PSIZE
loi 1 /* byte from 2nd copy */ loi 1 /* byte from 2nd copy */
loc 1 cms EM_WSIZE
loc EM_WSIZE zeq *2
cii
beq *2
loc (2 * 256) loc (2 * 256)
lol i lol i
adi EM_WSIZE adi EM_WSIZE /* 0x200 + i */
loc EM_WSIZE loc EM_WSIZE
loc 4 loc 4
cuu cuu
cal $fail cal $fail
asp 4 asp 4
2 2
lol b lal p4
loi EM_PSIZE
loi 1 /* byte from src */
lal p1 lal p1
loi EM_PSIZE loi EM_PSIZE
loi 1 /* byte from 1st copy */ loi 1 /* byte from 1st copy */
loc 1 cms EM_WSIZE
loc EM_WSIZE zeq *1
cii
beq *1
loc (1 * 256) loc (1 * 256)
lol i lol i
adi EM_WSIZE adi EM_WSIZE /* 0x100 + i */
loc EM_WSIZE loc EM_WSIZE
loc 4 loc 4
cuu cuu

View file

@ -42,16 +42,11 @@ src
lal p2 lal p2
loi EM_PSIZE loi EM_PSIZE
loi 1 /* byte from src */ loi 1 /* byte from src */
loc 1
loc EM_WSIZE
cii
lal p1 lal p1
loi EM_PSIZE loi EM_PSIZE
loi 1 /* byte from exchanged copy */ loi 1 /* byte from exchanged copy */
loc 1 cms EM_WSIZE
loc EM_WSIZE zeq *2
cii
beq *2
lol i lol i
loc EM_WSIZE loc EM_WSIZE
loc 4 loc 4