sim: Use the Guest ABI mechanism in writeFunc.
sim: Use the Guest ABI mechanism in writeFunc.

This change only modifies the writeFunc since it's easy to test using
the hello world test programs.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: Ia4a7bacdb9938d9fbe4093fc6958904d6c423360
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23192
Reviewed-by: Gabe Black <5c8aa1266c03186393d9e7b3b4e3b14239af8201@google.com>
Maintainer: Gabe Black <5c8aa1266c03186393d9e7b3b4e3b14239af8201@google.com>
Tested-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>

gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5