home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / amiga / programm / 15805 < prev    next >
Encoding:
Text File  |  1992-11-14  |  2.3 KB  |  64 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!ukma!netsys!decwrl!concert!sas!mozart.unx.sas.com!jamie
  3. From: jamie@cdevil.unx.sas.com (James Cooper)
  4. Subject: Re: New assembly programmer, need help, Why wouldn't this work?
  5. Originator: jamie@cdevil.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <BxnvK4.Buw@unx.sas.com>
  8. Date: Fri, 13 Nov 1992 15:40:51 GMT
  9. References:  <1992Nov13.060036.166761@zeus.calpoly.edu>
  10. Nntp-Posting-Host: cdevil.unx.sas.com
  11. Organization: SAS Institute Inc.
  12. Lines: 50
  13.  
  14.  
  15. In article <1992Nov13.060036.166761@zeus.calpoly.edu>, clin@zeus.calpoly.edu (Chihtsung Jeffrey Lin) writes:
  16. >Hi,
  17. >
  18. >I've just started taking a 68000 assembly language class. We do our class
  19. >works on Macs. Recently I've tried to do some assembly programming on my
  20. >Amiga but have not idea how to do it. I've tried some simple programs that
  21. >worked on the Macs assembler we use for our class, but none of them seems
  22. >to work. I have an A3000, and I've used A68K and asm for SAS C. The linker I
  23. >use is blink. Here's one I tried.
  24. >
  25. >
  26. >start:         move.w  #5,d0
  27. >
  28. >                               end
  29. >
  30. >
  31. >It seems to assemble and bind ok, but when I try to run it from CLI, it
  32. >gives me a Software Failure window, error #8000000B of #80000004. I know
  33. >that's silly program but I don't see any harm in doing that either. Are
  34. >there specific codes that are need for an Amiga program? (I did put a csect
  35. >directive for asm, btw). Oh yeah, I bound it with amiga.lib and lc.lib even
  36. >though I don't see any reason to.
  37. >
  38. >Any hint/ clue is appreciated.
  39.  
  40. Make one small change:
  41.  
  42. start:          move.w  #5,d0
  43.                 rts                     ; return!
  44.  
  45.                 end
  46.  
  47. and everything should work.
  48.  
  49. When you create a program on the Amiga, it is essentially run as if it
  50. were one big subroutine, so putting an RTS (ReTurn from Subroutine)
  51. instruction is a proper way to exit.
  52.  
  53. With your code the way you had it, it would do the "move" operation
  54. properly, then just start executing whatever happened to be in memory
  55. after that, because you didn't tell it when to stop.
  56.  
  57. -- 
  58. ---------------
  59. Jim Cooper
  60. (jamie@unx.sas.com)                             bix: jcooper
  61.  
  62. Any opinions expressed herein are mine (Mine, all mine!  Ha, ha, ha!),
  63. and not necessarily those of my employer.
  64.