Programing advice please (50g)
|
06-30-2023, 07:24 PM
(This post was last modified: 07-01-2023 06:45 PM by FLISZT.)
Post: #6
|
|||
|
|||
RE: Programing advice please (50g)
(06-30-2023 04:39 PM)mchris Wrote: Thank you all, it worked but I struggle to understand it The regular syntax - as mentioned by Nigel (UK) - is: Code: << TEST << … … >> IFT >> Code: << TEST << … >> << … >> IFTE >> But instead of instructions inside chevrons, you can use lists (at least with hp-48GX … 50G / not with hp-28): Code: << TEST { … … } { … … } IFTE >> It's also possible to use a TAG :: before ONE instruction. For example: << DUP2 > :: SWAP :: DROP2 IFTE >> Last but not least example: << 1 == << 9 'l' STO+ >> IFT >> … add 9 to the register l, if the value on the stack is equal to 1. But… writing 'l' is impossible inside a list. So, if you want use lists, the only solution I know of is that one (with a TAG): << 1 == { 0 ::l STO+ } IFT >> I hope I'm clear enough… Anyway, DavidM's solution to your question is the best. Edit: typo Bruno Sanyo CZ-0124 ⋅ TI-57 ⋅ HP-15C ⋅ Canon X-07 + XP-140 Monitor Card ⋅ HP-41CX ⋅ HP-28S ⋅ HP-50G ⋅ HP-50G |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Programing advice please (50g) - mchris - 06-30-2023, 03:51 PM
RE: Programing advice please (50g) - Nigel (UK) - 06-30-2023, 04:11 PM
RE: Programing advice please (50g) - FLISZT - 06-30-2023, 04:25 PM
RE: Programing advice please (50g) - mchris - 06-30-2023, 04:39 PM
RE: Programing advice please (50g) - FLISZT - 06-30-2023 07:24 PM
RE: Programing advice please (50g) - rprosperi - 06-30-2023, 09:38 PM
RE: Programing advice please (50g) - DavidM - 06-30-2023, 04:46 PM
RE: Programing advice please (50g) - Joe Horn - 06-30-2023, 08:41 PM
RE: Programing advice please (50g) - Gil - 07-01-2023, 12:48 AM
|
User(s) browsing this thread: 2 Guest(s)