> Is there any way of downloading a webpage into a buffer from
> assembler.
>
> Greg
This isn't by me, nor is it in ASM (I hope SPROW doesn't mind me
posting this.)... But it may point you to the correct SWIs... From
there it should be just a matter of converting the calls to use ASM...
910REM
**********************************************************************
920REM
* *
930REM * SWI calls for RISC OS
hosts *
940REM
* *
950REM
**********************************************************************
960DEFFNgethost_swi(name$)
970LOCALhost%,flags%
980SYS"XResolver_GetHost",name$ TO,host%;flags%
990IF(flags% AND1)<>0 THEN=0
1000=host%
1010:
1020DEFFNcreat_swi(pf%,type%,prot%)
1030LOCALhandle%,flags%
1040SYS"XSocket_Creat",pf%,type%,prot% TOhandle%;flags%
1050IF(flags% AND1)<>0 THEN=-1
1060=handle%
1070:
1080DEFFNbind_swi(handle%,addr%,addrlen%)
1090LOCALflags%
1100SYS"XSocket_Bind",handle%,addr%,addrlen% TO;flags%
1110IF(flags% AND1)<>0 THEN=-1
1120=0
1130:
1140DEFFNlisten_swi(handle%,count%)
1150LOCALflags%
1160SYS"XSocket_Listen",handle%,count% TO;flags%
1170IF(flags% AND1)<>0 THEN=-1
1180=0
1190:
1200DEFFNaccept_swi(handle%,addr%,addrlenblk%)
1210LOCALconn%,flags%
1220SYS"XSocket_Accept",handle%,addr%,addrlenblk% TOconn%;flags%
1230IF(flags% AND1)<>0 THEN=-1
1240=conn%
1250:
1260DEFFNconnect_swi(handle%,addr%,addrlen%)
1270LOCALflags%
1280SYS"XSocket_Connect",handle%,addr%,addrlen% TO;flags%
1290IF(flags% AND1)<>0 THEN=-1
1300=0
1310:
1320DEFFNrecv_swi(handle%,data%,len%,opts%)
1330LOCALrecd%,flags%
1340SYS"XSocket_Recv",handle%,data%,len%,opts% TOrecd%;flags%
1350IF(flags% AND1)<>0 THEN=-1
1360=recd%
1370:
1380DEFFNsend_swi(handle%,data%,len%,opts%)
1390LOCALsent%,flags%
1400SYS"Socket_Send",handle%,data%,len%,opts% TOsent%;flags%
1410IF(flags% AND1)<>0 THEN=-1
1420=sent%
1430:
1440DEFPROCshutdown_swi(handle%,type%)
1450SYS"XSocket_Shutdown",handle%,type%
1460ENDPROC
1470:
1480DEFPROCclose_swi(handle%)
1490SYS"XSocket_Close",handle%
1500ENDPROC
1510:
This is part of SPROW's HTTPServer program in BASIC. I hope he doesn't
mind me hacking it to pieces and posting it like this. If needs be and
SPROW sees this and doesn't mind, then I have the whole listing, else
he may be able to help further. Like I said, I was looking around the
other day and just happened to be curious.