Are there any simple assembly languages accessible to beginners?

I'm reading this book called 8080/8085 manual, in that to explain carry flag, it gave the below example:

Example:

Addition of two one-byte numbers can produce a carry out of the high-order bit:

Bit Number: 7654 3210

AE= 1010 1110

+74= 0111 0100

------------

0010 0010 = 22 carry flag = 1

I'm able to understands until "Addition of two one-byte numbers" after that sentence becomes incomprehensible, what is bit number? Is it a memory address? I assumed AE is hexadecimal but I can't figure out what +74 is. I don't know how 8 bit binary addition is done.

Are there any assembly languages simpler than this? Maybe 4 bits long, with which I can learn binary and assembly at once.

## 5 Replies - 810 Views - Last Post: 03 January 2020 - 09:48 AM

### #1

# Are there any simple assembly languages accessible to beginners?

Posted 29 December 2019 - 03:28 AM

##
**Replies To:** Are there any simple assembly languages accessible to beginners?

### #2

## Re: Are there any simple assembly languages accessible to beginners?

Posted 29 December 2019 - 04:50 AM

Maybe if it were formatted to line up correctly, it would help.

Where (1) represents the carry flag.

> what is bit number? Is it a memory address?

No, it's just numbering the bits.

Read it right to left.

Like,

- bit 7 of AE is 1

- bit 3 of 74 is 0

Consider it to be the numerical equivalent of thousands, hundreds, tens and units when describing the rank of decimal numbers.

Bit Number: 7654 3210 1010 1110 AE (1010 1110, written in hex) 0111 0100+ 74 (0111 0100, written in hex) ----------------- (1) 0010 0010 22

Where (1) represents the carry flag.

> what is bit number? Is it a memory address?

No, it's just numbering the bits.

Read it right to left.

Like,

- bit 7 of AE is 1

- bit 3 of 74 is 0

Consider it to be the numerical equivalent of thousands, hundreds, tens and units when describing the rank of decimal numbers.

### #3

## Re: Are there any simple assembly languages accessible to beginners?

Posted 29 December 2019 - 05:03 AM

To answer your general question as to whether there's an easier way into this topic: Probably not.

I'll try to help you get closer to understanding or figuring out what's going on here.

Perhaps think of it like this: Each number (from the 76543210) corresponds to the position of a bit within the binary number. For example in the binary 00100000, the 1 is at position 5 (or bit number 5).

(In some architectures the order may be reversed (i.e. the 1 in the above example would be bit number 2); you can perhaps read more about that here.)

As for the AE/74/addition/etc: It might be easier to think about if you convert between hexadecimal, decimal and binary; there's various tools online to help with this. The AE, 74 and 22 are all hexadecimal (and here you'll perhaps see why some prefer to always use the 0x prefix or -h suffix for hexadecimal numbers for the sake of clarity). AE + 74 (hex) is 174 + 116 (decimal). The result is 290, but the maximum value you can (typically) represent in an 8-bit byte is 255 - so there's an overflow.

290 in binary is 1 0010 0010 - which as you can see, is 9 bits. If you take the only 8 bits that can fit into the 8-bit byte, you're left with the 0010 0010 (which is 22 in hex - or 34 in decimal).

Hopefully this is enough for you to play with.

I'll try to help you get closer to understanding or figuring out what's going on here.

Perhaps think of it like this: Each number (from the 76543210) corresponds to the position of a bit within the binary number. For example in the binary 00100000, the 1 is at position 5 (or bit number 5).

(In some architectures the order may be reversed (i.e. the 1 in the above example would be bit number 2); you can perhaps read more about that here.)

As for the AE/74/addition/etc: It might be easier to think about if you convert between hexadecimal, decimal and binary; there's various tools online to help with this. The AE, 74 and 22 are all hexadecimal (and here you'll perhaps see why some prefer to always use the 0x prefix or -h suffix for hexadecimal numbers for the sake of clarity). AE + 74 (hex) is 174 + 116 (decimal). The result is 290, but the maximum value you can (typically) represent in an 8-bit byte is 255 - so there's an overflow.

290 in binary is 1 0010 0010 - which as you can see, is 9 bits. If you take the only 8 bits that can fit into the 8-bit byte, you're left with the 0010 0010 (which is 22 in hex - or 34 in decimal).

Hopefully this is enough for you to play with.

### #4

## Re: Are there any simple assembly languages accessible to beginners?

Posted 30 December 2019 - 02:48 AM

Salem_c, on 29 December 2019 - 04:50 AM, said:

Maybe if it were formatted to line up correctly, it would help.

Where (1) represents the carry flag.

> what is bit number? Is it a memory address?

No, it's just numbering the bits.

Read it right to left.

Like,

- bit 7 of AE is 1

- bit 3 of 74 is 0

Consider it to be the numerical equivalent of thousands, hundreds, tens and units when describing the rank of decimal numbers.

Bit Number: 7654 3210 1010 1110 AE (1010 1110, written in hex) 0111 0100+ 74 (0111 0100, written in hex) ----------------- (1) 0010 0010 22

Where (1) represents the carry flag.

> what is bit number? Is it a memory address?

No, it's just numbering the bits.

Read it right to left.

Like,

- bit 7 of AE is 1

- bit 3 of 74 is 0

Consider it to be the numerical equivalent of thousands, hundreds, tens and units when describing the rank of decimal numbers.

I formatted it correctly when I typed it, but when it was posted, it got jumbled.

### #5

## Re: Are there any simple assembly languages accessible to beginners?

Posted 01 January 2020 - 10:39 PM

Salem_c put it nicely.

And 8080/8085 and 6800 have probably the simplest assembly there is, and very well suited for learning the basics.

Note that the bit numbering is documentation convention, and it has nothing to do with the HW itself.

There is, however endianness (order of bytes of a multibyte number in memory) that is HW feature.

Carry is the same kind of carry that is used in conventional addition, but it's just binary here. It's used f.ex. "multi-entity" addition, like 16-bit addition on 8-bit processors. Addition of two n-bit numbers can produce an n+1-bit result, so addition of two least significant bytes may produce 9th bit which is the carry. Then instruction "ADC" (add with carry) is used to add the most significant bytes. It adds the bytes AND the carry. The carry-flag usually works as borrow-flag too, and is usually used as result of comparison (note that comparison is usually subtraction without keeping the result).

And 8080/8085 and 6800 have probably the simplest assembly there is, and very well suited for learning the basics.

Note that the bit numbering is documentation convention, and it has nothing to do with the HW itself.

There is, however endianness (order of bytes of a multibyte number in memory) that is HW feature.

Carry is the same kind of carry that is used in conventional addition, but it's just binary here. It's used f.ex. "multi-entity" addition, like 16-bit addition on 8-bit processors. Addition of two n-bit numbers can produce an n+1-bit result, so addition of two least significant bytes may produce 9th bit which is the carry. Then instruction "ADC" (add with carry) is used to add the most significant bytes. It adds the bytes AND the carry. The carry-flag usually works as borrow-flag too, and is usually used as result of comparison (note that comparison is usually subtraction without keeping the result).

This post has been edited by **turboscrew**: 01 January 2020 - 10:53 PM

### #6

## Re: Are there any simple assembly languages accessible to beginners?

Posted 03 January 2020 - 09:48 AM

I actually wrote some scuffed tutorials several years ago on here, and it was a very beginner friendly language. L3 or something, I don't remember. Once you get the hang of that you can probably move up to the big boy assemblers.

Page 1 of 1