HP-41 MCode question « Next Oldest | Next Newest »

 ▼ Jeff D Junior Member Posts: 39 Threads: 16 Joined: Jan 1970 11-02-2005, 01:17 PM I have written the following sequece in MCode1A0 A=B=C=0355 ?NC XQ050 ->14D50B8 READ 2(Y)0AE A<>C ALL0F8 READ 3(X)30E ?AC ALL070 N=C ALL10E A=C ALL135 ?NC XQ060 ->184D0E8 WRIT 3(X)My intention is to find the largest value between the A and C registers and square the value then write it back to the user X register. Unfortunately, when I use a fractional number with no integer value, the program does not produce the correct value.Any thoughts would be appreciated.Thanks,Jeff ▼ Frank Wales Member Posts: 117 Threads: 6 Joined: Mar 2006 11-02-2005, 04:20 PM (Well, it's been about half a billion seconds since I did any 41 machine code programming, but I think I see the problem...) You need to perform a floating-point comparison between the two values; the ?AY afterwords. This only yields "NO" whether the larger number is in the X or the Y registers. I understand that when executing these mcode routines from the keyboard will cause only "YES" or "NO" to be displayed, so I ran the routing from a user code program. This eliminated the "YES" or "NO" and left the numbers but still did not execute the X<>Y. I also tried the XX

 Possibly Related Threads... Thread Author Replies Views Last Post HP-41(CL): The easiest way to transfer FOCAL programs from a Linux PC to the HP-41 Geir Isene 13 1,082 12-05-2013, 02:40 AM Last Post: Hans Brueggemann HP-41 MCODE: The Last Function - at last! Ángel Martin 0 219 11-08-2013, 05:11 AM Last Post: Ángel Martin Non-Prime question alert: Hp-41 and synthetic instructions Marcel Samek 11 792 11-04-2013, 09:31 PM Last Post: sjthomas 41-MCODE: Auto XEQ+ALPHA possible? Ángel Martin 5 435 05-29-2013, 06:15 AM Last Post: Ángel Martin HP 41 Mcode related Questions Michael Fehlhammer 4 356 05-10-2013, 07:09 PM Last Post: Michael Fehlhammer 41-MCODE: Breaking the FAT barrier. Ángel Martin 0 179 09-03-2012, 06:31 AM Last Post: Ángel Martin 41-MCODE: Dr. Jekyll & Mr. Hyde Ángel Martin 9 588 07-09-2012, 09:41 AM Last Post: Monte Dalrymple hp 41 series wire-wrapped connector question. Matt Kernal 3 284 06-19-2012, 01:48 AM Last Post: Luiz C. Vieira (Brazil) HP41C: Factorial (kind of) in MCODE Frido Bohn 7 507 05-26-2012, 09:18 AM Last Post: Frido Bohn 41-MCODE: SOLVE & INTEG - 4k ROM Ángel Martin 9 553 04-19-2012, 05:29 AM Last Post: fhub

Forum Jump: