Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #1905 > unrolled thread
| Started by | Gazza <usenet@garethlock.com> |
|---|---|
| First post | 2012-07-10 07:09 -0700 |
| Last post | 2012-07-11 09:26 +0100 |
| Articles | 20 on this page of 63 — 18 participants |
Back to article view | Back to comp.sys.acorn.programmer
Assembler Help. Gazza <usenet@garethlock.com> - 2012-07-10 07:09 -0700
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-07-10 08:46 -0700
Re: Assembler Help. Chris Johnson <chrisjohnson+news@spamcop.net> - 2012-07-10 18:06 +0100
Re: Assembler Help. jgharston <jgh@arcade.demon.co.uk> - 2012-07-11 11:26 -0700
Re: Assembler Help. cferris@freeRemoveuk.com.invalid - 2012-07-11 20:05 +0100
Re: Assembler Help. jgharston <jgh@arcade.demon.co.uk> - 2012-07-11 15:16 -0700
Re: Assembler Help. Steve Drain <steve@kappa.me.uk> - 2012-07-12 10:25 +0100
Re: Assembler Help. cferris@freeRemoveuk.com.invalid - 2012-07-13 09:23 +0100
Re: Assembler Help. Steve Drain <steve@kappa.me.uk> - 2012-07-13 11:16 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-07-24 05:17 -0700
Re: Assembler Help. Gavin Wraith <gavin@wra1th.plus.com> - 2012-07-24 14:02 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-07-24 06:49 -0700
Re: Assembler Help. Steve Drain <steve@kappa.me.uk> - 2012-07-24 15:03 +0100
Re: Assembler Help. usenet@garethlock.com - 2012-07-24 08:21 -0700
Re: Assembler Help. Steve Drain <steve@kappa.me.uk> - 2012-07-24 17:55 +0100
Re: Assembler Help. Theo Markettos <theom+news@chiark.greenend.org.uk> - 2012-08-03 20:26 +0100
Re: Assembler Help. cferris@freeRemoveuk.com.invalid - 2012-08-05 08:51 +0100
Re: Assembler Help. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-07-24 20:04 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-07-24 14:16 -0700
Re: Assembler Help. Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2012-07-24 22:34 +0100
Re: Assembler Help. Chris Johnson <chrisjohnson+news@spamcop.net> - 2012-07-24 23:56 +0100
Re: Assembler Help. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-07-25 01:42 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-03 05:54 -0700
Re: Assembler Help. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-08-03 17:52 +0100
Re: Assembler Help. "Barry Allen (news)" <evanallen@onetel.net.uk.invalid> - 2012-08-04 10:21 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-04 15:57 -0700
Re: Assembler Help. cferris@freeRemoveuk.com.invalid - 2012-08-05 08:48 +0100
Re: Assembler Help. Martin <News03@avisoft.f9.co.uk> - 2012-08-06 10:00 +0100
Re: Assembler Help. Theo Markettos <theom+news@chiark.greenend.org.uk> - 2012-08-06 13:26 +0100
Re: Assembler Help. Martin <News03@avisoft.f9.co.uk> - 2012-08-06 23:13 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-07 08:50 -0700
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-07 15:43 -0700
Re: Assembler Help. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-08-08 00:52 +0100
Re: Assembler Help. usenet@garethlock.com - 2012-08-08 02:03 -0700
Re: Assembler Help. jeffrey.a.doggett@gmail.com - 2012-08-08 02:19 -0700
Re: Assembler Help. druck <news@druck.org.uk> - 2012-08-12 09:05 +0100
Re: Assembler Help. Frank de Bruijn <zuiderduin@hotmail.com> - 2012-08-08 11:40 +0200
Re: Assembler Help. Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2012-08-08 11:34 +0100
Re: Assembler Help. Justin Fletcher <gerph@gerph.org> - 2012-08-09 21:19 +0100
Re: Assembler Help. druck <news@druck.org.uk> - 2012-08-12 09:08 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-14 05:17 -0700
Re: Assembler Help. Chris Johnson <chrisjohnson+news@spamcop.net> - 2012-08-14 14:50 +0100
Re: Assembler Help. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-08-14 15:03 +0100
Re: Assembler Help. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-08-14 14:59 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-15 17:01 -0700
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-21 03:54 -0700
Re: Assembler Help. Martin <News03@avisoft.f9.co.uk> - 2012-08-21 12:27 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-21 05:08 -0700
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-21 05:25 -0700
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-21 08:23 -0700
Re: Assembler Help. druck <news@druck.org.uk> - 2012-08-21 18:19 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-21 14:20 -0700
Re: Assembler Help. cferris@freeRemoveuk.com.invalid - 2012-08-22 09:07 +0100
Re: Assembler Help. Gazza <usenet@garethlock.com> - 2012-08-22 05:28 -0700
Re: Assembler Help. Steve Fryatt <news@stevefryatt.org.uk> - 2012-08-22 14:47 +0100
Re: Assembler Help. druck <news@druck.org.uk> - 2012-08-22 23:11 +0100
Re: Assembler Help. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-08-29 18:36 +0100
Re: Assembler Help. Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2012-08-22 09:38 +0100
Re: Assembler Help. jgh@arcade.demon.co.uk (Jonathan Graham Harston) - 2012-08-08 23:15 +0100
Re: Assembler Help. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-08-09 13:59 +0100
Re: Assembler Help. Steve Drain <steve@kappa.me.uk> - 2012-08-10 15:50 +0100
Re: Assembler Help. Frank de Bruijn <zuiderduin@hotmail.com> - 2012-07-11 08:30 +0200
Re: Assembler Help. cferris@freeRemoveuk.com.invalid - 2012-07-11 09:26 +0100
Page 1 of 4 [1] 2 3 4 Next page →
| From | Gazza <usenet@garethlock.com> |
|---|---|
| Date | 2012-07-10 07:09 -0700 |
| Subject | Assembler Help. |
| Message-ID | <c12eb9f2-2787-4586-960d-3121d5ba7ddf@6g2000vbv.googlegroups.com> |
Following on from a previous topic. I've moved away from the Moria specific code and I'm trying to test out some theories. I am putting together a macro library of simple routines, things like sprint, sprinttab, strlen, strcat etc... I think I've got most of it written according to what I understand, anyway. I've picked up a way to set overflow flag from heyrick.co.uk CMP R0,#1<<31 CMNVS R0,#1<<31 I'm assuming that any register can be used for this purpose and that subbing 1<<31 with 0<<31 clears the overflow flag if set. I'm also looking for something that changes text cursor position. I'm assuming this is done by sending a sequence of bytes to the VDU drivers, but I'm at a loss to know what to send. The sprinttab routine has R0 pointing to the string, R1 points to the column and R2 points to the row on entry. Thanks in advance.
[toc] | [next] | [standalone]
| From | Gazza <usenet@garethlock.com> |
|---|---|
| Date | 2012-07-10 08:46 -0700 |
| Message-ID | <d85a2742-0924-4fe1-8158-54a791faf478@j9g2000vbk.googlegroups.com> |
| In reply to | #1905 |
I think I've answered my own question in regards to the VDU drivers... VDU 31,x,y So... MOV R3,R0 ; Get the string pointer out of the way. LDR R0,tmpbyte3 STRB #31,[R0],#1 ; VDU 31,col,row (col is R1, row is R2) STRB R1,[R0],#1 STRB R2,[R0],#1 MOV R1,#3 ; Write 3 bytes. ... Call OS to write sequence to VDU drivers. Do the rest of the display string routine. ... .tmpbyte3 : EQUB 0:EQUB 0:EQUB 0:ALIGN I believe the call is one of the OS_Write SWIs, but can't make out from StrongHelp Manuals which one it is.
[toc] | [prev] | [next] | [standalone]
| From | Chris Johnson <chrisjohnson+news@spamcop.net> |
|---|---|
| Date | 2012-07-10 18:06 +0100 |
| Message-ID | <52ad2f569bchrisjohnson+news@spamcop.net> |
| In reply to | #1906 |
In article <d85a2742-0924-4fe1-8158-54a791faf478@j9g2000vbk.googlegroups.com>, Gazza <usenet@garethlock.com> wrote: > LDR R0,tmpbyte3 > STRB #31,[R0],#1 ; VDU 31,col,row (col is R1, row is > R2) > STRB R1,[R0],#1 > STRB R2,[R0],#1 > MOV R1,#3 ; Write 3 bytes. > ... > Call OS to write sequence to VDU drivers. > Do the rest of the display string routine. > ... You probably want something like: mov r0, #31 swi "XOS_WriteC" mov r0, r1 swi "XOS_WriteC" mov r0, r2 swi "XOS_WriteC" -- Chris Johnson
[toc] | [prev] | [next] | [standalone]
| From | jgharston <jgh@arcade.demon.co.uk> |
|---|---|
| Date | 2012-07-11 11:26 -0700 |
| Message-ID | <7de0c570-88de-4854-a8b4-a84667ba8875@a16g2000vby.googlegroups.com> |
| In reply to | #1908 |
Chris Johnson wrote: > You probably want something like: > mov r0, #31 > swi "XOS_WriteC" > mov r0, r1 > swi "XOS_WriteC" > mov r0, r2 > swi "XOS_WriteC" or even: swi "XOS_WriteI"+31 mov r0, r1 swi "XOS_WriteC" mov r0, r2 swi "XOS_WriteC" SWI 256+n (OS_WriteI+n) sends 'n' to the output stream. JGH
[toc] | [prev] | [next] | [standalone]
| From | cferris@freeRemoveuk.com.invalid |
|---|---|
| Date | 2012-07-11 20:05 +0100 |
| Message-ID | <cd17bead52.cferris@cferris.freeuk.com> |
| In reply to | #1913 |
In message <7de0c570-88de-4854-a8b4-a84667ba8875@a16g2000vby.googlegro
ups.com>
jgharston <jgh@arcade.demon.co.uk> wrote:
> Chris Johnson wrote:
>> You probably want something like:
>> mov r0, #31
>> swi "XOS_WriteC"
>> mov r0, r1
>> swi "XOS_WriteC"
>> mov r0, r2
>> swi "XOS_WriteC"
> or even:
> swi "XOS_WriteI"+31
> mov r0, r1
> swi "XOS_WriteC"
> mov r0, r2
> swi "XOS_WriteC"
> SWI 256+n (OS_WriteI+n) sends 'n' to the output stream.
Did any of your extra commands to BASIC get put into the ROOL code?
Would it be possible to add ADRL to the RO5 version?
Thanks
--
Colin Ferris Cornwall UK
[toc] | [prev] | [next] | [standalone]
| From | jgharston <jgh@arcade.demon.co.uk> |
|---|---|
| Date | 2012-07-11 15:16 -0700 |
| Message-ID | <46cbda7c-6ed5-46e4-90f2-f15260dadfa1@b1g2000vbb.googlegroups.com> |
| In reply to | #1914 |
freeRemoveuk wrote: > Did any of your extra commands to BASIC get put into the ROOL code? I'm still tidying the code up to submit it back into the source repository. JGH
[toc] | [prev] | [next] | [standalone]
| From | Steve Drain <steve@kappa.me.uk> |
|---|---|
| Date | 2012-07-12 10:25 +0100 |
| Message-ID | <pLwLr.592684$n02.359611@fx02.am4> |
| In reply to | #1914 |
cferris wrote: > jgharston wrote: > >> SWI 256+n (OS_WriteI+n) sends 'n' to the output stream. > > Did any of your extra commands to BASIC get put into the ROOL code? > > Would it be possible to add ADRL to the RO5 version? I use Darren Salt's Extended BASIC Assembler, which adds this, and a whole range of other facilities, to the normal BASIC assembler. Unfortunately, it works by modifying a copy of the BASIC module to call routines in the support module, and it has not been updated since the first Select version. This means I have to soft-load an older version of BASIC, but I would not be without it. Darren is no longer active with RISC OS, I think, but I have wondered whether someone could incorporate his routines directly into the module. You can see what it does in a StrongHelp manual I wrote for it at: http://kappa.me.uk/StrongHelp/shExtBASasm010.zip Steve
[toc] | [prev] | [next] | [standalone]
| From | cferris@freeRemoveuk.com.invalid |
|---|---|
| Date | 2012-07-13 09:23 +0100 |
| Message-ID | <c9ec8aae52.cferris@cferris.freeuk.com> |
| In reply to | #1916 |
In message <pLwLr.592684$n02.359611@fx02.am4>
Steve Drain <steve@kappa.me.uk> wrote:
> cferris wrote:
>> jgharston wrote:
>>
>>> SWI 256+n (OS_WriteI+n) sends 'n' to the output stream.
>>
>> Did any of your extra commands to BASIC get put into the ROOL code?
>>
>> Would it be possible to add ADRL to the RO5 version?
[snip]
If not in the BASIC module - what about including it in BASALT.
I seem to remember that when ADRL was working - Zap would show :-
ADRL R0,&XXX
ADD/SUB R0,R0,#0
Very handy - for working out where the pointers pointing.
Is it possible to include the BASALT module in ROOL ROM without losing
control of it?
!Dissi output includes a MACRO for ADRL - which can be used with later
BASIC modules.
Thanks
--
Colin Ferris Cornwall UK
[toc] | [prev] | [next] | [standalone]
| From | Steve Drain <steve@kappa.me.uk> |
|---|---|
| Date | 2012-07-13 11:16 +0100 |
| Message-ID | <TBSLr.788865$kM1.611131@fx18.am4> |
| In reply to | #1918 |
cferris wrote: > Steve Drain wrote: >> cferris wrote: >>> Would it be possible to add ADRL to the RO5 version? > If not in the BASIC module - what about including it in BASALT. I am afraid the assembler is beyond the scope of the way Basalt works; the assembler keywords are not tokenised, nor case sensitive, and are directly interpreted. That is before you consider my own skill. > Is it possible to include the BASALT module in ROOL ROM without losing > control of it? The way the current versions of Basalt are written it is neither necessary, not practical, to install the module in System. All the resources Basalt needs are put in ResourcesFS. A copy of the module can be included in any application that is written to use it and RMEnsured from there. Only the latest ensured version will be present and programs will be able to tolerate the dynamic changing of module. [Note that the current versions are not backward compatible with the old version 0.98 with the Toolbox, but are in most other keywords] > !Dissi output includes a MACRO for ADRL - which can be used with later > BASIC modules. I think there is more than one library of BASIC assembler macros dating from early Archimedes days. Steve
[toc] | [prev] | [next] | [standalone]
| From | Gazza <usenet@garethlock.com> |
|---|---|
| Date | 2012-07-24 05:17 -0700 |
| Message-ID | <00b34021-c874-4533-b2ad-9524c021663a@fr28g2000vbb.googlegroups.com> |
| In reply to | #1921 |
Working on converting my LibASH to asm. This is in it's early stages. When I have the basic functionality set out, I will lay it all here for your perusal. Two things I need... The first, LibASH creates a heap from HIMEM. This obviously won't work as is for a stand-alone executable. Is there an easy way to find out the equivalent, so I can install a heap at the top of the user's WimpSlot without having the calling program having to hard-wire a value on compile time. The second, I need an equivalent of BASIC's MOD in asm. I can't see a direct instruction, so I'm guessing it's a combo of MUL and peeking at the flags, I'm guessing Carry, but could be wrong. Thanks in advance.
[toc] | [prev] | [next] | [standalone]
| From | Gavin Wraith <gavin@wra1th.plus.com> |
|---|---|
| Date | 2012-07-24 14:02 +0100 |
| Message-ID | <8aaf4eb452.wra1th@wra1th.plus.com> |
| In reply to | #1945 |
In message <00b34021-c874-4533-b2ad-9524c021663a@fr28g2000vbb.googlegroups.com>
Gazza <usenet@garethlock.com> wrote:
> The first, LibASH creates a heap from HIMEM. This obviously won't work
> as is for a stand-alone executable. Is there an easy way to find out
> the equivalent, so I can install a heap at the top of the user's
> WimpSlot without having the calling program having to hard-wire a
> value on compile time.
Use SWI "OS_GetEnv" ?
> The second, I need an equivalent of BASIC's MOD in asm.
DIVMOD appears to be everybody's favourite macro. There is one on
page 148 of Acorn Assembler Release 2, and no doubt there are others.
--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/
[toc] | [prev] | [next] | [standalone]
| From | Gazza <usenet@garethlock.com> |
|---|---|
| Date | 2012-07-24 06:49 -0700 |
| Message-ID | <b7b87a44-c7e1-4836-b84b-27f571f42388@j9g2000vbk.googlegroups.com> |
| In reply to | #1946 |
On Jul 24, 2:02 pm, Gavin Wraith <ga...@wra1th.plus.com> wrote: > In message <00b34021-c874-4533-b2ad-9524c0216...@fr28g2000vbb.googlegroups.com> > Gazza <use...@garethlock.com> wrote: > > > The first, LibASH creates a heap from HIMEM. This obviously won't work > > as is for a stand-alone executable. Is there an easy way to find out > > the equivalent, so I can install a heap at the top of the user's > > WimpSlot without having the calling program having to hard-wire a > > value on compile time. > > Use SWI "OS_GetEnv" ? > > > The second, I need an equivalent of BASIC's MOD in asm. > > DIVMOD appears to be everybody's favourite macro. There is one on > page 148 of Acorn Assembler Release 2, and no doubt there are others. > > -- > Gavin Wraith (ga...@wra1th.plus.com) > Home page:http://www.wra1th.plus.com/ Sorry Gavin... Maybe I should have been a bit clearer in my original post, I need to make the calculation in question during runtime, rather than at compile-time.
[toc] | [prev] | [next] | [standalone]
| From | Steve Drain <steve@kappa.me.uk> |
|---|---|
| Date | 2012-07-24 15:03 +0100 |
| Message-ID | <LYxPr.435808$Jh3.170715@fx28.am4> |
| In reply to | #1945 |
Gazza wrote: > The first, LibASH creates a heap from HIMEM. This obviously won't work > as is for a stand-alone executable. Is there an easy way to find out > the equivalent, so I can install a heap at the top of the user's > WimpSlot without having the calling program having to hard-wire a > value on compile time. I am not quite sure what you are after. HIMEM is available to assembler if code is CALLed. If it is ASH you are converting then I assume the code is for use with BASIC. In which case there are modules to provide the heap you require; SlidingHeaps and NonFragmentingHeaps come to mind, but there are others. Of course, Basalt has the routines, but in support of DIM and all other memory management. Do you want a heap in general? This cannot be above the WimpSlot, but you can extend the WS and create one below. The initial address of the end can be derived from SWI "Wimp_SlotSize", noting that tasks start at &8000. A heap can be created using SWI "OS_Heap". Variable heaps are more complicated. If you know the maximum size of the heap, reserve sufficient space above the end of your actual code and create one there. If you know the exact memory requirements then just reserve space in the code. Think about dynamic areas for large requirements. In desperation there is always SWI "OS_Module". ;-( You mention a stand-alone executable. Is that a Utility, an Absolute, a Module or what? You need to check out memory allocation. Remember that with BASIC, it is the actual task and keeps quite lot of memory management hidden. I suspect the correct answer is to use a language that supports memory claims. > The second, I need an equivalent of BASIC's MOD in asm. I can't see a > direct instruction, so I'm guessing it's a combo of MUL and peeking at > the flags, I'm guessing Carry, but could be wrong. MOD is the remainder after DIV. Efficient DIV code is the subject of much debate, and you can look this up on the web thingy. I use Extended BASIC Assembler which compiles a reasonably good DIV with a single pseudo-instruction. Steve
[toc] | [prev] | [next] | [standalone]
| From | usenet@garethlock.com |
|---|---|
| Date | 2012-07-24 08:21 -0700 |
| Message-ID | <42cc3ae7-22d6-4ae0-961a-4579e2c92bf7@googlegroups.com> |
| In reply to | #1948 |
On Tuesday, 24 July 2012 15:03:43 UTC+1, Steve Drain wrote: > Gazza wrote: > > The first, LibASH creates a heap from HIMEM. This obviously won't work > > as is for a stand-alone executable. Is there an easy way to find out > > the equivalent, so I can install a heap at the top of the user's > > WimpSlot without having the calling program having to hard-wire a > > value on compile time. > > I am not quite sure what you are after. HIMEM is available to assembler > if code is CALLed. If it is ASH you are converting then I assume the > code is for use with BASIC. In which case there are modules to provide > the heap you require; SlidingHeaps and NonFragmentingHeaps come to mind, > but there are others. Of course, Basalt has the routines, but in support > of DIM and all other memory management. > > Do you want a heap in general? This cannot be above the WimpSlot, but > you can extend the WS and create one below. The initial address of the > end can be derived from SWI "Wimp_SlotSize", noting that tasks start at > &8000. A heap can be created using SWI "OS_Heap". > > Variable heaps are more complicated. > > If you know the maximum size of the heap, reserve sufficient space above > the end of your actual code and create one there. > > If you know the exact memory requirements then just reserve space in the > code. > > Think about dynamic areas for large requirements. In desperation there > is always SWI "OS_Module". ;-( > > You mention a stand-alone executable. Is that a Utility, an Absolute, a > Module or what? You need to check out memory allocation. Remember that > with BASIC, it is the actual task and keeps quite lot of memory > management hidden. > > I suspect the correct answer is to use a language that supports memory > claims. > > > The second, I need an equivalent of BASIC's MOD in asm. I can't see a > > direct instruction, so I'm guessing it's a combo of MUL and peeking at > > the flags, I'm guessing Carry, but could be wrong. > > MOD is the remainder after DIV. Efficient DIV code is the subject of > much debate, and you can look this up on the web thingy. > > I use Extended BASIC Assembler which compiles a reasonably good DIV with > a single pseudo-instruction. > > Steve By executable, I'm thinking Absolute or Utility, I'm by no way brave enough to attempt to hand assemble a module yet... I must admit, I hadn't thought of Dynamic areas, I guess I could create one of those and whack it there where it's supported, however, I do need a fallback for RISC PC type machines that still run a minimum of OS v3.60. I suppose I could use an available Module to implement Dynamic areas of sorts if these weren't available natively. Any help or pointers would be appreciated. If someone could also point me to an HTML version of Acorn Assembler Release 2, I'd be grateful. Thx
[toc] | [prev] | [next] | [standalone]
| From | Steve Drain <steve@kappa.me.uk> |
|---|---|
| Date | 2012-07-24 17:55 +0100 |
| Message-ID | <MtAPr.341148$%k.52934@fx20.am4> |
| In reply to | #1949 |
garethlock wrote: > By executable, I'm thinking Absolute or Utility They are quite separate beasts; you would not be looking at a heap with a utility, I think. > I suppose I could use an available Module to implement Dynamic areas > of sorts if these weren't available natively. No longer supported I fear, but for relatively small requirements you can use the backwards compatible version of Tony Houghton's THHeap. Steve
[toc] | [prev] | [next] | [standalone]
| From | Theo Markettos <theom+news@chiark.greenend.org.uk> |
|---|---|
| Date | 2012-08-03 20:26 +0100 |
| Message-ID | <Gtl*-LWbu@news.chiark.greenend.org.uk> |
| In reply to | #1950 |
Steve Drain <steve@kappa.me.uk> wrote: > garethlock wrote: > > I suppose I could use an available Module to implement Dynamic areas > > of sorts if these weren't available natively. > > No longer supported I fear, but for relatively small requirements you > can use the backwards compatible version of Tony Houghton's THHeap. DAs have been around since RISC OS 3.5, so it's only RO3.1 machines it wouldn't work on. Theo
[toc] | [prev] | [next] | [standalone]
| From | cferris@freeRemoveuk.com.invalid |
|---|---|
| Date | 2012-08-05 08:51 +0100 |
| Message-ID | <a14660ba52.cferris@cferris.freeuk.com> |
| In reply to | #1974 |
In message <Gtl*-LWbu@news.chiark.greenend.org.uk>
Theo Markettos <theom+news@chiark.greenend.org.uk> wrote:
> Steve Drain <steve@kappa.me.uk> wrote:
>> garethlock wrote:
>>> I suppose I could use an available Module to implement Dynamic areas
>>> of sorts if these weren't available natively.
>>
>> No longer supported I fear, but for relatively small requirements you
>> can use the backwards compatible version of Tony Houghton's THHeap.
> DAs have been around since RISC OS 3.5, so it's only RO3.1 machines it
> wouldn't work on.
Also there was a DA module by JF for the RO3.1 - used the Sprite area
I believe.
--
Colin Ferris Cornwall UK
[toc] | [prev] | [next] | [standalone]
| From | Martin Bazley <martin.bazley@blueyonder.co.uk> |
|---|---|
| Date | 2012-07-24 20:04 +0100 |
| Message-ID | <37e16fb452.martin@blueyonder.co.uk> |
| In reply to | #1945 |
The following bytes were arranged on 24 Jul 2012 by Gazza : > The first, LibASH creates a heap from HIMEM. This obviously won't work > as is for a stand-alone executable. Is there an easy way to find out > the equivalent, so I can install a heap at the top of the user's > WimpSlot without having the calling program having to hard-wire a > value on compile time. SWI "OS_GetEnv" STR R1,maxmemptr% > The second, I need an equivalent of BASIC's MOD in asm. I can't see a > direct instruction, so I'm guessing it's a combo of MUL and peeking at > the flags, I'm guessing Carry, but could be wrong. You're using the wrong language. ARM code is notoriously devoid of any divide function whatsoever. Is the value you want to divide by a power of two? You can use the shift, AND and BIC instructions to perform the equivalent of division. For example: MOV R0,R0,ASR #1 ; divide by 2 (signed) MOV R0,R0,LSR #1 ; divide by 2 (unsigned) MOV R0,R0,LSR #2 ; divide by 4 (unsigned) MOV R0,R0,LSL #3 ; multiply by 8 (signed and unsigned) AND R1,R0,#3 ; R1 = R0 MOD 4 BIC R1,R0,#15 ; R1 = (R0/16)*16 And old faithful here: ADD R0,R0,#3 BIC R0,R0,#3 ; word-align R0 -- __<^>__ "Your pet, our passion." - Purina / _ _ \ "Your potential, our passion." - Microsoft, a few months later ( ( |_| ) ) \_> <_/ ======================= Martin Bazley ==========================
[toc] | [prev] | [next] | [standalone]
| From | Gazza <usenet@garethlock.com> |
|---|---|
| Date | 2012-07-24 14:16 -0700 |
| Message-ID | <bff11025-77e6-41ef-b1f1-b43de621118a@e20g2000vbm.googlegroups.com> |
| In reply to | #1951 |
On Jul 24, 8:04 pm, Martin Bazley <martin.baz...@blueyonder.co.uk>
wrote:
> The following bytes were arranged on 24 Jul 2012 by Gazza :
>
> > The first, LibASH creates a heap from HIMEM. This obviously won't work
> > as is for a stand-alone executable. Is there an easy way to find out
> > the equivalent, so I can install a heap at the top of the user's
> > WimpSlot without having the calling program having to hard-wire a
> > value on compile time.
>
> SWI "OS_GetEnv"
> STR R1,maxmemptr%
>
> > The second, I need an equivalent of BASIC's MOD in asm. I can't see a
> > direct instruction, so I'm guessing it's a combo of MUL and peeking at
> > the flags, I'm guessing Carry, but could be wrong.
>
> You're using the wrong language. ARM code is notoriously devoid of any
> divide function whatsoever.
>
> Is the value you want to divide by a power of two? You can use the
> shift, AND and BIC instructions to perform the equivalent of division.
> For example:
>
> MOV R0,R0,ASR #1 ; divide by 2 (signed)
> MOV R0,R0,LSR #1 ; divide by 2 (unsigned)
> MOV R0,R0,LSR #2 ; divide by 4 (unsigned)
> MOV R0,R0,LSL #3 ; multiply by 8 (signed and unsigned)
> AND R1,R0,#3 ; R1 = R0 MOD 4
> BIC R1,R0,#15 ; R1 = (R0/16)*16
>
> And old faithful here:
>
> ADD R0,R0,#3
> BIC R0,R0,#3 ; word-align R0
>
> --
> __<^>__ "Your pet, our passion." - Purina
> / _ _ \ "Your potential, our passion." - Microsoft, a few months later
> ( ( |_| ) )
> \_> <_/ ======================= Martin Bazley ==========================
What I'm doing is a byte fill routine that performs a check on a value
only if the current pointer value is word aligned. I
R0 --> Base address of block.
R1 --> Fill value.
.blkfill : ...
R2 = Working register.
R3 = Working copy of R0
R4 = &DEADDEAD
R5 = base+size (This is actually worked out by subtracting 4 from the
pointer and reading the size stored there. The REAL base address is
the given base address -8.)
.blkfill_lp : MOD R2,R3,#4
CMP R2,#0
BNE blkfill_lp2
LDR R2,[R3]
CMP R2,R4
BEQ blkfill_exit
.blkfill_lp2 : STRB R1,[R3],#1
CMP R3,R5
BLE blkfill_lp
.blkfill_exit : <restore regs and return>
... If MOD was an instruction that returned the modulo (R2=R3 MOD 4).
So I'm performing the word aligned load, ONLY if the pointer is word
aligned. As this routine deals with blocks accessed byte at a time,
the only word aligned value that makes any sense, should be the high
water mark &DEADDEAD.
[toc] | [prev] | [next] | [standalone]
| From | Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> |
|---|---|
| Date | 2012-07-24 22:34 +0100 |
| Message-ID | <mpro.m7op9200chhio01t4@wingsandbeaks.org.uk.invalid> |
| In reply to | #1952 |
Gazza <usenet@garethlock.com> wrote: > So I'm performing the word aligned load, ONLY if the pointer is word > aligned. Can you not do that by checking that the bottom two bits are zero? -- Jeremy C B Nicoll - my opinions are my own. Email sent to my from-address will be deleted. Instead, please reply to newsreplyaaa@wingsandbeaks.org.uk replacing "aaa" by "284".
[toc] | [prev] | [next] | [standalone]
Page 1 of 4 [1] 2 3 4 Next page →
Back to top | Article view | comp.sys.acorn.programmer
csiph-web