Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- helpful: https://www.rapidtables.com/convert/number/hex-to-decimal.html
- --DATA SIZES--
- size binary hexadecimal
- nybble 0010 2
- byte 0010 1100 2C
- word 0010 1100 1111 0101 2C F5
- long-word 0010 1100 1111 0101 1001 1101 0111 0110 2C F5 9D 76
- ---------------------------------------------------------------------------------------------------------------------------------------
- If you group two nybbles together (e.g. 0100 1101), you get what is known as a “byte”.
- If you group two “bytes” together (e.g. 0100 1101 1011 0000), you get what is known as a “word”.
- If you group two “words” together (e.g. 0100 1101 1011 0000 1111 0001 0000 0110), you get what is known as a “long-word”.
- ---------------------------------------------------------------------------------------------------------------------------------------
- --SYMBOLS--
- # Number that follows is an offset/address.
- $ Hex numbers will follow.
- % Binary numbers will follow.
- " " Nothing means it'll be a decimal number that follows.
- ---------------------------------------------------------------------------------------------------------------------------------------
- --ADDRESS REGISTERS--
- move.b #$44, (a0) moves 44 into (not replace) a0.
- ---------------------------------------------------------------------------------------------------------------------------------------
- scenario: (a0) contains 00000039
- move.b #$9B,$04(a0) = #$9B goes into 00000039; then add 04
- Answer: 0000003D
- ---------------------------------------------------------------------------------------------------------------------------------------
- movea.l #$00000010,a0
- move.b #$20,$01(a0)
- move.b #$40,$02(a0)
- move.b #$F0,$0F(a0)
- move.b #$0E,(a0)
- 00000010 is moved into a0
- 20 is moved to 00000010 plus 01 = 00000011
- 40 is moved to 00000010 plus 02 = 00000012
- F0 is moved to 00000010 plus 0F = 0000001F
- 0E is moved to 00000010 directly = 00000010
- ---------------------------------------------------------------------------------------------------------------------------------------
- --AUTO INCREMENT--
- movea.l #$00000020,a0 = 00000020
- move.b #$B5,(a0)+ = 00000021 (B5 moves into 00000020 then is increamented by 1)
- move.b #$11,(a0)+ = 00000022
- ---------------------------------------------------------------------------------------------------------------------------------------
- movea.l #$00000020,a0 = 00000020 (spreads over to 21 because of its size)
- move.w #$A90E,(a0)+ = 00000022
- ---------------------------------------------------------------------------------------------------------------------------------------
- --AUTO DECREMENT--
- movea.l #$00000020,a0 = 00000020
- move.b #$2E,-(a0) = 0000001F
- ---------------------------------------------------------------------------------------------------------------------------------------
- move.w d0,d1 = this will copy whatevers in d0 to d1 (words worth amount)
- ---------------------------------------------------------------------------------------------------------------------------------------
- move.w d0,$0000104E = If d0 contains 99004980, then 4980 is copied to memory at offsets 0000104E and 0000104F
- ---------------------------------------------------------------------------------------------------------------------------------------
- --ADD--
- addi.b #$08,d0 = adds 8 to whatevers in d0 (a bytes worth)
- ---------------------------------------------------------------------------------------------------------------------------------------
- addi.b #$08,d0 = if d0 started with 00001008, after the instruction d0 will contain 00001010 (because, 8 9 A B C D E F 10)
- ---------------------------------------------------------------------------------------------------------------------------------------
- add.w d0,d1 = If d0 contains FED00100, and d1 contains 00000100, after the instruction d1 will contain 00000200.
- ---------------------------------------------------------------------------------------------------------------------------------------
- --SUB--
- subi.b #$10,d0 = if d0 has 0000002E, after it will have 0000001E
- ---------------------------------------------------------------------------------------------------------------------------------------
- --NOT--
- not.b d0 = let’s say d0 contains FE800174; 74 is 0111 0100 in binary; 0111 0100 becomes 1000 1011. 74 > 8B
- ---------------------------------------------------------------------------------------------------------------------------------------
- --SWAP--
- swap d0 = 2222EEEE changes to EEEE2222
- ---------------------------------------------------------------------------------------------------------------------------------------
- --EXG--
- exg.l d0,d1 = if d0 has 00000000 and d1 has 11111111; d0 will have 11111111 and d1 will have 00000000
- ---------------------------------------------------------------------------------------------------------------------------------------
- --CLR-- = if d0 has 01234567, d0 will have 01234500 (wipes a bytes worth)
- ---------------------------------------------------------------------------------------------------------------------------------------
- --AND--
- Scenario: d0 contains 01234567
- andi.b #$E2,d0 = E2 in binary is 11100010 | 67 in binary is 01100111. Each number is compared to true or false. 1 & 1 scores 1 anything else will score 0.
- Answer: 01100010 = E2 AND 67 = 62 (Answers 62)
- ---------------------------------------------------------------------------------------------------------------------------------------
- --OR--
- Scenario: d0 contains 01234567
- ori.b #$EC,d0 = EC in binary is 11101100 and as we know 67 in binary is 01100111. Each number is compared to true and false. Anything with a 1 in it scores 1, otherwise its 0.
- Answer: 11101111 = EC OR 67 = EF (Answers EF)
- ---------------------------------------------------------------------------------------------------------------------------------------
- --EOR-- / --XOR--
- Scenario: do contains 01234567
- eori.b #$E2,d0 = E2 in binary is 11100010 and yet again as we know 67 in binary is 01100111. Each number is comapred to true and false. Anything with just a single 1 in it will score 1 otherwise it'll be a 0.
- Answer: 10000101 = E2 XOR 67 = 85 (Answers 85)
- ---------------------------------------------------------------------------------------------------------------------------------------
- --BSET--
- Scenario: d0 is cleared, 32bits all contain 0's
- bset.l #$0E,d0 = This puts a 1 in 0E, from which in binary is 0000 0000 0000 0000 0100 0000 0000 0000, from which in hex is 00004000
- Notes: If what ever is being injected takes the register over 1F (1F is the highest number); the register will wrap back round to 00 again. 20 becomes 00, 21 is 01, 22 is 02 etc... needs to be within range.
- ---------------------------------------------------------------------------------------------------------------------------------------
- --BCLR--
- Notes: Does the same as BSET but instead of putting a 1 in, it puts a 0.
- ---------------------------------------------------------------------------------------------------------------------------------------
- --BCHG--
- Notes: Swaps whatever the binary number is. 1 becomes 0, 0 becomes 1.
- ---------------------------------------------------------------------------------------------------------------------------------------
- --SIGNED-- / --UNSIGNED--
- 00 to 7F = signed. (negative)
- 80 to FF = signed. (positive)
- 00 to FF = unsigned. (positive)
- ---------------------------------------------------------------------------------------------------------------------------------------
- --NEG--
- Scenario: d0 has 220002
- neg.b d0 = 002200FE (02 to FE, +2 to -2, rolls back)
- Notes: This wont work with neutral numbers, 00 can't cancel out 00; 80 is the beginning of the negative, therefore it will have nothing (00).
- ---------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement