TSTEQ and BNZ/BZ Command Confusion

Ha! I remember writing 650x code by typing hex numbers into a memory monitor, calculating branch offsets in my head (no assembler with fancy mnemonics and labels required!).

Nice!  You should be right at home then!
 
I spent years hand coding a 6800 system via hex keypad. I hear you about the branch offsets! I only know a little about the 6502 as compared to the 6800. I remember that the BSR relative branches were only inside that 256 byte page or something like that. The 6800 was not page dependant but still only +128/-127 offsets. The index register worked the opposite of the 6800. In 6800 the 16 bit index register could be used as a base with a relative offsets to it. I believe that was opposite in the 6502. LOL Later I switched to 6809 using OS9 multi-user/ multi-tasking Unix-like O/S. Paid $1000 for a 64K memory board populated to 16K bytes. I had to write my own HDD and floppy drivers to make it work. Funny how Windoze took 20 more years to even approach the multi-tasking system that  had.
 
Been a long time! The hex codes are mostly gone from my mind now after hmmmmm... 36 years?
 
I miss those days too. My father ran an RCA 1802  processor. That thing didn't even have a standard subroutine call and return (JSR, RTS) instructions. We used to have competitions to see who could write code tighter to do the same job. Funnily enough, It was mostly less than 1% difference. 1 bit music was easier on the 1802 as every instruction took two clock cycles.
 
Man you would be good to "have a few beers with" !
 
I spent years hand coding a 6800 system via hex keypad

Wow...my first job was to modify a existing program that controlling an automated airbag fuse production machine. That program was written in assembly, hand translated to machine code and burned into EPROM, because boss did not want to spend $20K for a Z80 assembler. I did not want to hand translate whole program either.  So I first found the location we needed to change in the EPROM, changed those bytes into GOTO then the address of the empty area on that EPROM.  Added new function there, then GOTO next instruction after the original location.  Burned that into EPROM, then replaced the old EPROM with this new one. It worked....
 
I have an even funnier one.
 
Back in the ole' days when early eproms  had UV erase windows on them I spent the big buck on a huge 1024 byte unit. I think it was about $65 and that was considered a new "cheap" price for these high-density memory chips.
 
Well I rigged up a burning jig using  three 9v batteries to get my 27 volt burning pulse and voila! a new operating system for my CPU kit! Now the hard part comes. In my new found confidence I need to create a new version and I am not going to spend that money again for another EPROM so I have to erase the old one.
 
Remembering my mother telling me they had UV lamps to clean hairbrushes and combs when she went to hairdressing school I marched into the local hairdressing school past all the women and asked if I could put something in their sterilising box. I had no idea what this would look like! Permission was granted and I placed this little windowed device stuck in some black foam at the bottom of the purple glowing box with all the furry combs and brushes.
 
I came back in an hour and picked up the IC only to return home and find it wasn't clean!  GRRRRR... Going back I repeated the same embarrassing thing but this time left if for a few hours before returning. Luckily it was clean...all $FFs. Whew!
 
Years later my father gave me my own UV lamp for Christmas and I never made use of it right up until I threw it out before moving 8 years ago.
 
I'm still confused about bnz-bz....
 
 
I sure that everyone here are able to write a plc code but i'm not sure that everyone write proper codes. BNZ or CZ can make our code more readable, smaller and more flexible. The user guide is perfect for a programmer but for other people like me it's a little bit harder. Doable but harder. 
 
I don't understand your confusion.  I don't see a question in your post to help you with.
 
Did you read the beginning of this thread? There may be an answer in the first few posts.
 
 
 
Edit: adjusted abrupt sounding tone of response.
 
Hi Efried,
 
The syntax is in the programming guide,  For example, bnz was described:
Code:
bnz (a) b
If the optional a operand is specified it is tested for a nonzero
value. If a is not specified then the zero bit is tested for
non-zero. If true then program jumps to label specified in
operand b.
 
CAI_Support said:
Hi Efried,
 
The syntax is in the programming guide,  For example, bnz was described:

bnz (a) b
If the optional a operand is specified it is tested for a nonzero
value. If a is not specified then the zero bit is tested for
non-zero. If true then program jumps to label specified in
operand b.
Could you please explain the correct use of bit access, byte access, and 16bit access in this context? is there some casting signed-unsigned before the comparison?
 
Efried,
 
bit, byte and 16 bit are all unsigned, however, the top bit could be interpret differently.
The easiest way to learn them is to
SET  VAR1   variable-you-not-sure
and see yourself what the value actually is on screen.
 
Back
Top