Post Reply 
"New-Yorke" ?
07-11-2020, 01:05 AM (This post was last modified: 07-11-2020 01:13 AM by sunhp.)
Post: #24
RE: "New-Yorke" ?
(06-29-2020 06:17 AM)cyrille de brébisson Wrote:  Hello,
Quote: Raymond Del Tondo Wrote:
(06-27-2020 12:29 PM)Giuseppe Donnini Wrote:
Not even Horror Mode (aka MASD syntax), introduced with the HP-49G in 1999, is considered level 3—which is only consistent since these are by no means actual instructions, but mere macros (which surely would have won haut la main the "International Obfuscated SASM Code Contest", if it existed).
You nailed it:-)
ΗΑ! Big Grin I concur! Big Grin
Regards,
Jonathan

HEY NOW, I TAKE OFFENCE TO THAT!
MASD syntax was pure genius, with functionality that are still missing from languages like C++!

Look at what it can produce for example: Such a snipet of code (which actually comes from MASD itself!) would have taken 5 pages in the other syntax, making understanding the actual code an absolute pain.

Code:
% write debug info
CD1EX D1=C R4=C.A                                 % save start address
A=0.A DAT1=A.A D1+5                               % write a 0 (nb entries)
D0=(5)_DebugInfoBuffer+#5 C=0.A C=DAT0.B D0-5     % Ba: pos in buffer, D0: on buffer
B=0.A                                             % Ba: nb entries
A=DAT0.A ?A#0.A                                   % is the buffer used?
{
  B+1.XS B-C.A                                    % get nb of used entries in first buffer
  C+C.A C+C.A A+C.A C+C.A A+C.A D0=A C=B.A C+C.A C+B.A C+C.A C+C.A GOSBVL MOVEDOWN % copy them
  {                                               % for each buffer
    D0+2 A=DAT0.A D0=A ?A=0.A EXIT                % end of the list?
    LC 00100 B+C.A                                % 100 more entries
    LC(5)_DebugBufferSize-#7 GOSBVL MOVEDOWN      % copy buffer
    UP
  }
  % invert the data to be from low address to high address
  CD1EX D1=C RSTK=C C=R4.A D0=C                   % point on start and end
  C=B.A DAT0=C.A D0+5                             % write nb entries
  BSRB.A B-1.A SKC                                % for nb entries/2 do
  {
    D1-12 A=DAT0.12 C=DAT1.12 DAT0=C.12 DAT1=A.12 D0+12 % invert the entries
    B-1.A UPNC                                    % next
  }
  C=RSTK D1=C
}

MASD syntax added a slew of great features, including some that are still missing from most common languages even C++.
But let us look at the MASD syntax in details to understand the what and whys...
The first BIG change with other ASM languages is the multi instruction per line and the drop of the "first column=label" concept (which where inherited from punch cards!).
2 Things there. First, MASD nearly got rid of all labels. A good MASD code will have little to no labels in it (see later). Second, labels are prefixed by a "*" avoiding the first column=label.
This frees room on the screen.
Now, the 48 had 4 lines of 22 characters. That is all! so allowing more instructions per lines allowed you to actually SEE your program (What can you do with minimal instructions if you only see 4 of them at a time!!!). With masd syntax, you could see around 16 instructions at a time! SO MUCH BETTER for a programmer!

This was allowed by the multi instructions per line and the unneded redudancy on repeated registers. A=A+B A can be replaced by A+B A (since the A= is kind of redudant)...
Please note that, FOR clarity, the devil that is the MASD syntax allowed the use of a '.' as a field separator so as to clearly link the field with the instruction a in A+B.A C+D.A where you can clearly see 2 distinct instructions (I did toy, at some point, with the idea that the 'A' field would be by default, thus making it optional. I also toyed with the idea of 'last field use is default', but discarded this as it would be, in my opinion, error prone, making subsequent instruction dependent on previous ones)...

MASD allowed for great use of constants, subsequently defined constants and the like which made programming much easier than what we had before. simillary, you could do D1+34 instead of having to do D1=D1+ 16
D1=D1+ 16
D1=D1+2

But, the BEST thing about masd is of course the blocks {} which can be used in the same way that they be in C or java. Add to this the up/exit "n" syntax, which allowed you to exit, or return to the top of a block at this or any other level and this really transformed ASM programming from the crud it was to something that was 1/2 way up the chain to a "real langauge"...

So, here you go, MASD was a great syntax, 100 times better than the SASM one.
And I would continue saying it, even if I did not, as it goes, have a "slight" bias :-)

Cyrille

I would like to confirm that MASD was a pure genius syntax (labels, { }, syntax, etc.)
I unfortunately used it a bit late while I was actively coding games for the HP48, nobody can imagine how much time I saved by using MASD instead of ASM or J-ASM (Laurent Jouanneau) exotic asm syntax.

Here is my SuperMario48 MASD syntax I have created and edited directly with a real HP48 and it was so fun do code it in 1998 ~ 1999. Wow 20+ years ago.
http://jadegame.com/file/hp/smhpsrc/sources/Src30.wri

great job Cyrille!
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
"New-Yorke" ? - Jonathan Busby - 06-15-2020, 07:27 PM
RE: "New-Yorke" ? - cyrille de brébisson - 06-16-2020, 05:48 AM
RE: "New-Yorke" ? - Jonathan Busby - 06-16-2020, 07:35 PM
RE: "New-Yorke" ? - pinkman - 06-16-2020, 11:03 PM
RE: "New-Yorke" ? - cyrille de brébisson - 06-17-2020, 05:42 AM
RE: "New-Yorke" ? - Jonathan Busby - 06-17-2020, 07:51 PM
RE: "New-Yorke" ? - cyrille de brébisson - 06-18-2020, 05:50 AM
RE: "New-Yorke" ? - Jonathan Busby - 06-18-2020, 07:17 PM
RE: "New-Yorke" ? - pinkman - 06-18-2020, 06:46 AM
RE: "New-Yorke" ? - pinkman - 06-18-2020, 10:11 PM
RE: "New-Yorke" ? - Jonathan Busby - 06-18-2020, 10:36 PM
RE: "New-Yorke" ? - Jonathan Busby - 06-18-2020, 10:49 PM
RE: "New-Yorke" ? - EugeneNine - 06-18-2020, 11:17 PM
RE: "New-Yorke" ? - Steve Simpkin - 06-19-2020, 03:49 AM
RE: "New-Yorke" ? - Jonathan Busby - 06-19-2020, 07:28 PM
RE: "New-Yorke" ? - Giuseppe Donnini - 06-27-2020, 02:29 AM
RE: "New-Yorke" ? - EdS2 - 06-27-2020, 05:44 AM
RE: "New-Yorke" ? - Jonathan Busby - 06-27-2020, 08:42 PM
RE: "New-Yorke" ? - Raymond Del Tondo - 06-28-2020, 12:33 AM
RE: "New-Yorke" ? - Jonathan Busby - 06-28-2020, 04:35 PM
RE: "New-Yorke" ? - Giuseppe Donnini - 06-28-2020, 01:17 AM
RE: "New-Yorke" ? - Jonathan Busby - 06-28-2020, 04:33 PM
RE: "New-Yorke" ? - cyrille de brébisson - 06-29-2020, 06:17 AM
RE: "New-Yorke" ? - sunhp - 07-11-2020 01:05 AM
RE: "New-Yorke" ? - aamiel - 07-15-2020, 11:42 AM
RE: "New-Yorke" ? - Jonathan Busby - 07-15-2020, 07:59 PM



User(s) browsing this thread: 6 Guest(s)